package com.ht.impl.drawtool;

import java.awt.event.MouseEvent;

/**
 * Created by IntelliJ IDEA.
 * User: Administrator
 * Date: 2012-3-21
 * Time: 10:34:47
 * To change this template use File | Settings | File Templates.
 */
public class CubeTool extends  RectTool{
   public int index;

    public CubeTool() {
        this("shape=htPowerPlant");
    }

    public CubeTool(String style) {
        super(style);
        if (style == null)
            setStyle("");
        if (!getStyle().endsWith(";"))
            setStyle(getStyle() + ";");
        index = getStyle().length();
    }

    public void updateRect(MouseEvent e) {
        super.updateRect(e);
        boolean isClockwise = e.isControlDown();
        style = style.substring(0, index);

        int startAngle = 0;
        int position = 1;

        style += ("startAngle" + "=" + startAngle + ";" + "rectPosition" + "=" + position);
        cell.setStyle(style);
    }
}
